package com.smh.demo1.a08;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shiminghui
 * @date 2025/4/12 13:16
 * @description: TODO
 */
@RestController
@Slf4j
public class MyController {
    @Autowired
    @Lazy
    private BeanForApplication beanForApplication;
    @Autowired
    @Lazy
    private BeanForSession beanForSession;
    @Autowired
    @Lazy
    private BeanForRequest beanForRequest;

    @RequestMapping("/test")
    public String test() {
        return "<ul>\n" +
                "    <li>request scope" + beanForRequest + "</li>\n" +
                "    <li>session scope" + beanForSession + "</li>\n" +
                "    <li>application scope" + beanForApplication + "</li>\n" +
                "</ul>\n";
    }
}
